import { DataTypes } from "sequelize";
import sequelize from "../database/index.js";

const Home = sequelize.define(
  "Home",
  {
    id: {
      type: DataTypes.INTEGER,
      autoIncrement: true,
      primaryKey: true,
      comment: "主键，自增ID",
    },
    name: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "名称",
    },
    head_shot: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "头像URL",
    },
    image: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "图片URL",
    },
    hot: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "热门信息",
    },
    info: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "信息",
    },
    video: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "视频URL",
    },
    dynamic_info: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "动态信息",
    },
    dynamic_video: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "动态视频URL",
    },
    categories: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "类别",
    },
  },
  {
    tableName: "home_page",
    timestamps: false,
    comment: "首页信息表，存储主页相关信息",
  }
);

export default Home;
